﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>Microwave: Microwave.fsmcpp Source File</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                Examples using state machines generated by StateBuilderCpp
            </h1>
            <h3>
                Microwave: Microwave.fsmcpp Source File
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">Microwave.fsmcpp</div>  </div>
</div>
<div class="contents">
<a href="_microwave_8fsmcpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> encoding=<span class="stringliteral">&quot;UTF-8&quot;</span>?&gt;
<a name="l00002"></a>00002 &lt;sm:StateMachine xmlns:sm=<span class="stringliteral">&quot;http://www.stateforge.com/StateMachineCpp-v1&quot;</span>
<a name="l00003"></a>00003                  xmlns:xsi=<span class="stringliteral">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span>
<a name="l00004"></a>00004                  xsi:schemaLocation=<span class="stringliteral">&quot;http://www.stateforge.com/StateMachineCpp-v1</span>
<a name="l00005"></a>00005 <span class="stringliteral">                                     http://www.stateforge.com/xsd/StateMachineCpp-v1.xsd&quot;</span> &gt;
<a name="l00006"></a>00006 
<a name="l00007"></a>00007   &lt;!-- General settings --&gt;
<a name="l00008"></a>00008   &lt;settings asynchronous=<span class="stringliteral">&quot;false&quot;</span> library=<span class="stringliteral">&quot;std&quot;</span>&gt;
<a name="l00009"></a>00009     &lt;description&gt;<a class="code" href="class_microwave.html">Microwave</a>&lt;/description&gt;
<a name="l00010"></a>00010     &lt;<span class="keywordtype">object</span> instance=<span class="stringliteral">&quot;microwave&quot;</span> <span class="keyword">class</span>=<span class="stringliteral">&quot;Microwave&quot;</span> include=<span class="stringliteral">&quot;Microwave.h&quot;</span>/&gt;
<a name="l00011"></a>00011   &lt;/settings&gt;
<a name="l00012"></a>00012   
<a name="l00013"></a>00013   &lt;!-- Events --&gt;
<a name="l00014"></a>00014   &lt;events&gt;
<a name="l00015"></a>00015     &lt;eventSource name=<span class="stringliteral">&quot;Microwave&quot;</span>&gt;
<a name="l00016"></a>00016       &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evStart&quot;</span>/&gt;
<a name="l00017"></a>00017       &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evStop&quot;</span>/&gt;
<a name="l00018"></a>00018       &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evTurnOn&quot;</span>/&gt;
<a name="l00019"></a>00019       &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evTurnOff&quot;</span>/&gt;
<a name="l00020"></a>00020     &lt;/eventSource&gt;
<a name="l00021"></a>00021     &lt;eventSource name=<span class="stringliteral">&quot;CookingAnalyzer&quot;</span>&gt;
<a name="l00022"></a>00022       &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evCookingDone&quot;</span>/&gt;
<a name="l00023"></a>00023     &lt;/eventSource&gt;
<a name="l00024"></a>00024     &lt;eventSource name=<span class="stringliteral">&quot;Door&quot;</span>&gt;
<a name="l00025"></a>00025       &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evDoorOpened&quot;</span>/&gt;
<a name="l00026"></a>00026       &lt;<span class="keyword">event</span> <span class="keywordtype">id</span>=<span class="stringliteral">&quot;evDoorClosed&quot;</span>/&gt;
<a name="l00027"></a>00027     &lt;/eventSource&gt;
<a name="l00028"></a>00028   &lt;/events&gt;
<a name="l00029"></a>00029 
<a name="l00030"></a>00030   &lt;!-- States --&gt;
<a name="l00031"></a>00031   &lt;state name=<span class="stringliteral">&quot;Top&quot;</span>&gt;
<a name="l00032"></a>00032     &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evStop&quot;</span> nextState=<span class="stringliteral">&quot;End&quot;</span>/&gt;
<a name="l00033"></a>00033     &lt;state name=<span class="stringliteral">&quot;Initial&quot;</span>&gt;
<a name="l00034"></a>00034       &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evStart&quot;</span> nextState=<span class="stringliteral">&quot;Operating&quot;</span>/&gt;
<a name="l00035"></a>00035     &lt;/state&gt;
<a name="l00036"></a>00036     &lt;state name=<span class="stringliteral">&quot;Operating&quot;</span>&gt;
<a name="l00037"></a>00037       &lt;parallel nextState=<span class="stringliteral">&quot;End&quot;</span>&gt;
<a name="l00038"></a>00038         &lt;!-- First region is the engine --&gt;
<a name="l00039"></a>00039         &lt;state name=<span class="stringliteral">&quot;Engine&quot;</span>&gt;
<a name="l00040"></a>00040           &lt;state name=<span class="stringliteral">&quot;Off&quot;</span>&gt;
<a name="l00041"></a>00041             &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evTurnOn&quot;</span>
<a name="l00042"></a>00042                         condition=<span class="stringliteral">&quot;&amp;amp;context.GetParentContext().GetParallelOperating().GetContextDoor().GetState() == &amp;amp;MicrowaveDoorOpenState::GetInstance()&quot;</span>
<a name="l00043"></a>00043                         nextState=<span class="stringliteral">&quot;Idle&quot;</span>/&gt;
<a name="l00044"></a>00044             &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evTurnOn&quot;</span> nextState=<span class="stringliteral">&quot;Cooking&quot;</span>/&gt;
<a name="l00045"></a>00045           &lt;/state&gt;
<a name="l00046"></a>00046           &lt;state name=<span class="stringliteral">&quot;On&quot;</span>&gt;
<a name="l00047"></a>00047             &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evTurnOff&quot;</span> nextState=<span class="stringliteral">&quot;Off&quot;</span>/&gt;
<a name="l00048"></a>00048             &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evCookingDone&quot;</span> nextState=<span class="stringliteral">&quot;Off&quot;</span>/&gt;
<a name="l00049"></a>00049             &lt;state name=<span class="stringliteral">&quot;Idle&quot;</span>&gt;
<a name="l00050"></a>00050               &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evDoorClosed&quot;</span> nextState=<span class="stringliteral">&quot;Cooking&quot;</span>/&gt;
<a name="l00051"></a>00051             &lt;/state&gt;
<a name="l00052"></a>00052             &lt;state name=<span class="stringliteral">&quot;Cooking&quot;</span>&gt;
<a name="l00053"></a>00053               &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evDoorOpened&quot;</span> nextState=<span class="stringliteral">&quot;Idle&quot;</span>/&gt;
<a name="l00054"></a>00054             &lt;/state&gt;
<a name="l00055"></a>00055           &lt;/state&gt;
<a name="l00056"></a>00056         &lt;/state&gt;
<a name="l00057"></a>00057         &lt;!-- Second region is the door --&gt;
<a name="l00058"></a>00058         &lt;state name=<span class="stringliteral">&quot;Door&quot;</span>&gt;
<a name="l00059"></a>00059           &lt;state name=<span class="stringliteral">&quot;DoorClose&quot;</span>&gt;
<a name="l00060"></a>00060             &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evDoorOpened&quot;</span> nextState=<span class="stringliteral">&quot;DoorOpen&quot;</span>/&gt;
<a name="l00061"></a>00061           &lt;/state&gt;
<a name="l00062"></a>00062           &lt;state name=<span class="stringliteral">&quot;DoorOpen&quot;</span>&gt;
<a name="l00063"></a>00063             &lt;transition <span class="keyword">event</span>=<span class="stringliteral">&quot;evDoorClosed&quot;</span> nextState=<span class="stringliteral">&quot;DoorClose&quot;</span>/&gt;
<a name="l00064"></a>00064           &lt;/state&gt;
<a name="l00065"></a>00065         &lt;/state&gt;
<a name="l00066"></a>00066       &lt;/parallel&gt;
<a name="l00067"></a>00067     &lt;/state&gt;
<a name="l00068"></a>00068     &lt;state name=<span class="stringliteral">&quot;End&quot;</span> kind=<span class="stringliteral">&quot;final&quot;</span>/&gt;
<a name="l00069"></a>00069   &lt;/state&gt;
<a name="l00070"></a>00070 &lt;/sm:StateMachine&gt;
<a name="l00071"></a>00071 
</pre></div></div>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
